<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
    String contextPath = request.getContextPath();
    Client client = (Client)request.getAttribute("client");
    List<ClientType> typeList = (List<ClientType>)request.getAttribute("tplist");
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="com.zhangyj.entitis.Client"%>
<%@page import="com.zhangyj.entitis.SystemParam"%>
<%@page import="com.zhangyj.component.ToolBar"%>
<%@page import="java.util.List"%>
<%@page import="com.zhangyj.entitis.ClientType"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@include file="/WEB-INF/jsps/head.jsp" %>
<style type="text/css">
.tbclass { background:#ccc; color:#555;width:400px;}
.tbclass thead td{ background:#f8f8f8;}
.tbclass tr { background:#fff;}
.tbclass tr td{line-height:1.8em;height:26px;}
.colbg{background:#e8e8e8;}
</style>
</head>
<body>
<%
	ToolBar toolbar = new ToolBar();
	toolbar.setTitle("客户信息添加");
	toolbar.put(new ToolBar.Item("返回", "_setLocation('"+contextPath+"/client/list.do')"));
	toolbar.writer(out);
%>
<form action="<%=contextPath %>/client/save.do">
<%=SystemParam.getSystemParam(request).toInput() %>
<input name="khbh" type="hidden" value="<%=client.getKhbh() %>"/>
<table cellspacing="1" cellpadding="6" class="tbclass">
	<tr>
		<td class="colbg">客户名称：</td>
		<td><input name="khxm" value="<%=client.getKhxm() %>"/></td>
	</tr>
	<tr>
		<td class="colbg">客户类型：</td>
		<td algin="left"> <select name="hylh" id="hylh" >
      <%for (int i = 0;i < typeList.size();i++) { 
    	  ClientType ctype = typeList.get(i);
      %>
            <option value="<%=ctype.getHylh() %>"><%=ctype.getHylm() %></option>
	    <%} %>
	    </select>
<script>
function getObj(obj) {
	return document.getElementById(obj);
}
function doSelect(objSel,conVal){
	for(var i=0;i<objSel.options.length;i++){
        if(objSel.options[i].value == conVal){
        	objSel.options[i].selected=true;
            break;
        }
    }  
}
 doSelect(getObj("hylh"),'<%=client.getHylh() %>')
</script>
		</td>
	</tr>
	<tr>
		<td class="colbg">客户地址：</td>
		<td><input name="khdz" value="<%=client.getKhdz() %>"/></td>
	</tr>
	<tr>
		<td class="colbg">联系电话：</td>
		<td><input name="lxdh" value="<%=client.getLxdh() %>"/></td>
	</tr>
	<tr>
		<td class="colbg">电子邮件：</td>
		<td><input name="dzyj" value="<%=client.getDzyj() %>"/></td>
	</tr>
	<tr>
		<td class="colbg">账户余额：</td>
		<td><input name="zhye" value="<%=client.getZhye() %>"/></td>
	</tr>
</table>
<input type="submit" value="提交">
<input type="reset">
</form>
</body>
</html>